import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/about',
      name: 'about',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/AboutView.vue')
    },
    {
      path: '/parent',
      name: 'parent',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/ParentView.vue')
    },
    {
      path: '/son',
      name: 'son',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: () => import('../views/SonView.vue')
    },
    {
      path: '/zizhi',
      name: 'zizhi',
      // route level code-splitting
      // this generates a separate chunk (About.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      meta: { permiss: { 'delete': true, 'edit': false } },
      component: () => import('../views/Zhiling.vue')
    },
    {
      path: '/store',
      name: 'store',
      component: () => import('../views/StoreTest.vue')
    },
    {
      path: "/we",
      name: 'we',
      component: () => import('../components/WelcomeItem.vue')
    },
    {
      path: "/dong",
      name: 'dong',
      component: () => import('../views/Dong.vue')
    },
    {
      path: '/cang',
      name: 'cang',
      component: () => import('../views/Cang.vue')
    },
    {
      path: '/hook',
      name: 'hook',
      component: () => import('../views/Hook/Hook.vue')
    },
    {
      path: '/deep',
      name: 'deep',
      component: () => import('../views/Deep.vue')
    }
  ]
})

export default router
